import { goto } from "@/utils";
import { ref } from "vue";

const useLogin = () => {
  const userModel = ref({
    username: "",
    password: "",
  });

  const login = () => {
    uni.setStorageSync("token", "token");
    goto("./index");
  };
  const register = () => {
    login();
  };

  return {
    userModel,
    login,
    register,
  };
};

export default useLogin;
